"use strict";
cc._RF.push(module, '744dcs4DCdNprNhG0xwq6FK', 'LocalizedLabel');
// src/LocalizedLabel.js

"use strict";

var n = module.exports = {};
var t = module;

var i = require('LanguageData');

cc.Class({
  "extends": cc.Component,
  editor: {
    executeInEditMode: !0,
    menu: "i18n/LocalizedLabel"
  },
  properties: {
    dataID: {
      get: function get() {
        return this._dataID;
      },
      set: function set(e) {
        this._dataID !== e && (this._dataID = e, this.updateLabel());
      }
    },
    _dataID: ""
  },
  onLoad: function onLoad() {
    i.inst || i.init(), this.fetchRender();
  },
  fetchRender: function fetchRender() {
    var e = this.getComponent(cc.Label);
    if (e) return this.label = e, void this.updateLabel();
  },
  updateLabel: function updateLabel() {
    this.label ? i.t(this.dataID) && (this.label.string = i.t(this.dataID)) : cc.error("Failed to update localized label, label component is invalid!");
  }
});

cc._RF.pop();